import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import vueParticles from 'vue-particles'
import Vcomp from './components/index'
import Toast from './components/toast'
import VueResource from 'vue-resource'
import domain from './utils/domain.js'
import Tools from './utils/tools'
// import echarts from 'echarts' //echarts
// import echartsGL from 'echarts-gl' // 引入echarts

import '@/assets/styles/base.scss'
import '@/assets/styles/common.scss'
import '@/assets/iconfont/iconfont.css'

import BaiduMap from 'vue-baidu-map'

global.domain = domain;

Vue.use(BaiduMap, {
    // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key /
    ak:'AlmXYmGntOsAbnGD5iMGv4CsGwAt7qjL'
})

Vue.use(vueParticles)
Vue.use(Vcomp)
Vue.use(VueResource)
// Vue.prototype.$echartsGL = echartsGL // 引入组件（将echarts注册为全局）
// Vue.prototype.$echarts = echarts // 引入组件（将echarts注册为全局）

Vue.config.productionTip = false

Vue.prototype.$Toast = Toast

Vue.use(Tools)

// 为了解决setItemEvent不立即生效，使用事件派发强制更高
Tools.dispatchEventStroage()


router.beforeEach((to, from, next) => {
	if (to.meta.title) {
	  document.title = to.meta.title;
	}
	next();
})




new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')
